import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.GridLayout;
import java.io.IOException;
import java.net.ServerSocket;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;

import javax.swing.DefaultListModel;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JTextPane;
import javax.swing.border.EmptyBorder;
import javax.swing.DefaultComboBoxModel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.BoxLayout;

public class relay extends JFrame {

	private JFrame frame;

	private JPanel contentPane;
	public static mymodel modelo;
	public static Map<String, nodoservidor> servidores = new ConcurrentHashMap<String, nodoservidor>();
	public static Map<String, Thread> listatareas = new ConcurrentHashMap<String, Thread>();
	public static JTextPane textPane = new JTextPane();
	public final static Logger milogger = Logger
			.getLogger(Logger.GLOBAL_LOGGER_NAME);

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					 MyLogger.setup();
					 relay.milogger.info("arranco relay ");
					relay frame = new relay();
					frame.setVisible(true);
					escucha miescucha = new escucha();
					miescucha.start();
					pintor mipintor= new pintor();
					mipintor.execute();
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public relay() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 796, 466);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);

		JSplitPane splitPane = new JSplitPane();
		contentPane.add(splitPane, BorderLayout.CENTER);
		splitPane.setDividerLocation(100);

		JList list = new JList();
		splitPane.setLeftComponent(list);
		modelo = new mymodel();
		list.setModel(modelo);
		renderer mirender= new renderer ();
		list.setCellRenderer(mirender);

		JPanel panel = new JPanel();
		splitPane.setRightComponent(panel);

		textPane = new JTextPane();
		panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
		panel.add(textPane);
	}

}
